package chap09;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;

public class UDP_client {
    public static void main(String [] args) throws IOException {
        DatagramSocket socket=new DatagramSocket(3000);
        DatagramPacket packet=new DatagramPacket(new byte[1024],1024);
        socket.receive(packet);//开始接受
        System.out.println("接受的内容是" + new String(packet.getData()));
    }
}
